home *** CD-ROM | disk | FTP | other *** search
/ Internet Tools (InfoMagic) / Internet Tools.iso / applic / ncsa / tn3270 / staffset.script.Z / staffset.script
Text File  |  1989-11-18  |  21KB  |  665 lines

  1. .cs begin
  2.  
  3.  
  4.     *------------------------------------------------------------*
  5.     |                                                            |
  6.     |  This is the STAFFSET file used to create a standard       |
  7.     |  formatting environment for all Brown Computer Center      |
  8.     |  documentation.  It sets up the page layout and defines    |
  9.     |  MACROs that facilitate uniform formatting.                |
  10.     |                                                            |
  11.     |                                          HRB               |
  12.     |                                          06/16/77          |
  13.     |                                                            |
  14.     |  Revisions:                                                |
  15.     |                                                            |
  16.     |    01/15/86  Replaced .BS hexjoins with "&x'nn"s --ahr    |
  17.     |                                                            |
  18.     |    12/28/82  Changed .blt, .alp, and .seq to prevent       |
  19.     |              justification from inserting blanks           |
  20.     |              between the bullet and the text.              |
  21.     |                                                            |
  22.     |              Added error checking for end out of           |
  23.     |              sequence.                                     |
  24.     |                                                            |
  25.     |              Removed use of /02 and /03 in these macros.   |
  26.     |                                                            |
  27.     |              Added logical line continuation with "("      |
  28.     |                                        -jb                 |
  29.     |                                                            |
  30.     |    04/14/82  Box and bracket translation only if           |
  31.     |              &SYSTERMT = TERM.  Formerly if SYSONLINE = Y  |
  32.     |                                                            |
  33.     |    07/26/77  ADJUST value set only if not already set by   |
  34.     |              user;  line length set to 64;  parentheses    |
  35.     |              are underscored;  offset in EXAM remote now   |
  36.     |              5;  conditional page for examples.            |
  37.     |                                                            |
  38.     |    12/13/77  The SEQ remote has been modified so that the  |
  39.     |              BLT remote can be used within a SEQ and yield |
  40.     |              a properly formatted result.                  |
  41.     |                                                            |
  42.     |    02/28/78  Reference words for left and right brackets   |
  43.     |              added;  "corners" translated online.          |
  44.     |                                                            |
  45.     |    03/20/78  Table of Contents added for decimal blocks    |
  46.     |              (thanks to JBB);  .cp value increased in      |
  47.     |              .topic remote;  .head remotes added.          |
  48.     |                                                            |
  49.     |    06/01/78  General cleanup.  Several enhancements added; |
  50.     |              see documentation for details.                |
  51.     |                                                            |
  52.     |    07/01/78  Indexing capability added.                    |
  53.     |                                                            |
  54.     |    03/29/79  TOFC remote changed for compatibility with    |
  55.     |              modified operation of .TC control word.       |
  56.     |                                                            |
  57.     |    05/05/80  Added remote to start pagenumber in bottom    |
  58.     |              title on the second page (automatically)      |
  59.     |              fixed various macros to work with 3.5         |
  60.     |              replaced the footnote macros with stolen      |
  61.     |              versions from sysezdef.  Formatted the tentry |
  62.     |              macro, added conditional spacing to most      |
  63.     |              macros.  Generally mucked things around.      |
  64.     |              What would Henri say? -- jb.                  |
  65.     |                                                            |
  66.     |    05/08/80  Different adjust values, using command        |
  67.     |              line option &BINDING= LEFT|CENTER .           |
  68.     |              Formatted some other macros;                  |
  69.     |              compromised on conditional spacing.           |
  70.     |              Bullets, numeric points, and alphabetic       |
  71.     |              points are now uniformly indented             |
  72.     |              one space, with text starting in four         |
  73.     |              spaces, and are generated using               |
  74.     |              'undent' instead of 'output overlay'.         |
  75.     |              Tentry defaults to indent of 10.              |
  76.     |              Blanks are now underscored only in            |
  77.     |              in blocks and heads.         --rn.            |
  78.     |                                                            |
  79.     |    05/29/80  Removed sysbot remote for starting            |
  80.     |              pagenumbering; set '.pi 0' and removed        |
  81.     |              .pp macro; added a check for previous         |
  82.     |              imbed of staffset; tab char now defaults;     |
  83.     |              'endnote' alternative to footnotes. --rn.     |
  84.     |                                                            |
  85.     *------------------------------------------------------------*
  86.  
  87.  
  88.  
  89. .cs end
  90. .*
  91. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  92. .*
  93. .*       Make sure file hasn't already been imbedded.
  94. .*
  95. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  96. .*
  97. .if &$stimbed eq 'YES';.th .ef
  98. .sr $stimbed = 'YES'
  99. .*
  100. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  101. .*
  102. .*       Define and initialize our reference words.  By
  103. .*       convention, all of our reference words are
  104. .*       prefixed with a dollar sign.  Reference words
  105. .*       used locally within a single macro are
  106. .*       preceded by a "*", according to SCRIPT conventions.
  107. .*
  108. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  109. .*
  110. .sr $alpct = 1               ;.cm  .alp index value
  111. .sr $alppend = 0             ;.cm  .alp pending
  112. .sr $b1ct = 0                ;.cm  decimal block counters
  113. .sr $b2ct = 0                ;.cm  ...
  114. .sr $b3ct = 0                ;.cm  ...
  115. .sr $bltpend = 0             ;.cm  .blt pending
  116. .se $binding = &binding      ;.cm  adjust control
  117. .sr $fnct = 0                ;.cm  footnote count
  118. .sr $fnconv = ''             ;.cm  footnote conversion instructions
  119. .sr $fnout = ''              ;.cm  current footnote text
  120. .sr $fnlen = 0               ;.cm  length of symbols around footnote
  121. .se $index = &index          ;.cm  index control
  122. .sr $nestlevel = 0           ;.cm  nesting level of macros
  123. .sr $pitb1 = 'Y'             ;.cm  table of contents flags
  124. .sr $pitb2 = 'Y'             ;.cm  ...
  125. .sr $pitb3 = 'Y'             ;.cm  ...
  126. .sr $pith1 = 'N'             ;.cm  ...
  127. .sr $pith2 = 'N'             ;.cm  ...
  128. .sr $pith3 = 'N'             ;.cm  ...
  129. .sr $seqct = 1               ;.cm  .seq counter
  130. .sr $seqpend = 0             ;.cm  .seq pending
  131. .sr $tenin = 99              ;.cm  .tentry indent value
  132. .sr $tenof = 10              ;.cm  .table entry offset
  133. .sr $trigger = 55            ;.cm  page eject trigger
  134. .sr $spb = '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'
  135. .*
  136. .sr $lbr = "&x'ad."          ;.cm  left bracket
  137. .sr $rbr = "&x'bd."          ;.cm  right bracket
  138. .sr $ulc = "&x'ac."          ;.cm  upper left-hand corner
  139. .sr $urc = "&x'bc."          ;.cm  upper right-hand corner
  140. .sr $llc = "&x'ab."          ;.cm  lower left-hand corner
  141. .sr $lrc = "&x'bb."          ;.cm  lower right-hand corner
  142. .sr $bullet = "&x'af."       ;.cm  bullet
  143. .*
  144. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  145. .*
  146. .*       Modify footnote instructions if endnotes are requested.
  147. .*       If current terminal type is regular terminal, change footnotes
  148. .*       to be inline numerals surrounded by parentheses.
  149. .*       If any online terminal, convert a few special characters to
  150. .*       facsimiles.
  151. .*
  152. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  153. .*
  154. ..su off
  155. ..cw
  156. ..su ..if '&SYSTERMT' eq TERM
  157. .  ..th ..sr $fnconv = |..sr $fnout =  '(&$fnct.)';..sr $fnlen = 3+&l'&$fnct|
  158. .  ..el ..sr $fnconv = |..sr $fnout = &S'&$fnct.;..sr $fnlen = 1+&l'&$fnct|
  159. ..su ..if '&NOTE' eq END
  160. .  ..th ..sr $enconv = |..sr $fnout = '&$fnct.&$hex02';..sr $fnlen = 5;..sr $fnun = 2+&l'&$fnct|
  161. .  ..el ..sr $enconv = |..sr $fnun = &$fnlen|
  162. ..su on
  163. ..cw ;
  164. .if '&systermt' eq TERM
  165. .th .do
  166. .tr ac * bc * ab * bb * bf - af - ad < bd >
  167. .do end
  168. .*
  169. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  170. .*
  171. .*       Set up page format.
  172. .*       Allowance is made for two heading lines.
  173. .*       Paragraphs are not indented.
  174. .*
  175. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  176. .*
  177. .ll 64;.tm 8;.hm 4;.hs 2;.bm 7;.fm 2
  178. .tt 1 ////;.tt 2 ////;.bt ////
  179. .wd yes
  180. .pi 0
  181. .*
  182. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  183. .*
  184. .*       Set up adjust values for left or center binding.
  185. .*       Default adjust value is 2, to allow for revision bars;
  186. .*       this can be easily changed to a margin of 10, suitable for
  187. .*       NW printing, or alternate margins of 13 and 6, for use
  188. .*       with back-to-back printing, by specifiying LEFT or CENTER
  189. .*       on the SCRIPT command line:
  190. .*
  191. .*                SCRIPT filename (+BINDING= LEFT | CENTER
  192. .*
  193. .*
  194. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  195. .*
  196. .if &sysad eq 0
  197. .   .th .ad 2
  198. .   .el .cm
  199. .if &$binding eq CENTER
  200. .   .th .do begin
  201. .      .ad 6
  202. .      .ad odd 7
  203. .      .em yes
  204. .      .do end
  205. .   .el .cm
  206. .if &$binding eq LEFT
  207. .   .th .do begin
  208. .      .ad 10
  209. .      .em no
  210. .      .do end
  211. .   .el .cm
  212. .*
  213. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  214. .*
  215. .*       Set up index.  The index will be printed when the .pix
  216. .*       macro is called, but only if indexing has been
  217. .*       enabled by means of a new command line option:
  218. .*
  219. .*                SCRIPT filename (&INDEX= YES
  220. .*
  221. .*
  222. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  223. .*
  224. .if &$index = YES
  225. .th .do
  226. .dm sysix0 /.sk 1/.in 0/.cc 4/&1/
  227. .dm sysix1 /.in 0/.hi 1/
  228. .dm sysix2 /.in 3/.hi 1/
  229. .dm sysix3 /.in 6/.hi 1/
  230. .sr sysixref = '^^'
  231. .dm pix begin
  232. .pa
  233. .head1 'Index'
  234.  ^
  235. .co
  236. .ju no
  237. .su on
  238. .cl (&sysll-2)/2
  239. .sr gutter = &sysll-2*&syscl
  240. .cd 2 0 &syscl+&gutter
  241. .ix . dump
  242. .sc
  243. .in 0
  244. .dm pix end
  245. .do end
  246. .el .do
  247. .dm ix //
  248. .dm pix //
  249. .do end
  250. .*
  251. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  252. .*
  253. .*       Set up Table of Contents.  For best results, the last
  254. .*       line of the file should invoke the following macro:
  255. .*
  256. .*                 .tofc
  257. .*
  258. .*
  259. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  260. .*
  261. .dh 1 to ts noj
  262. .dh 2 to nts tcin 1
  263. .dh 3 to nts tcin 2
  264. .*
  265. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  266. .*
  267. .*       Define special characters:  "," becomes the no-break
  268. .*       control indicator;  "!" is defined as the hilight escape
  269. .*       character;  "^" is defined as the special, non-expandable
  270. .*       blank;  "|" is defined as the revision character for
  271. .*       revision level 1;  "(" is the character to cause the
  272. .*       next line to be appended (without a blank) to the current
  273. .*       line.
  274. .*
  275. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  276. .*
  277. .dc linb ,
  278. .ud set !
  279. .dc rb ^
  280. .dc cont (
  281. .rc 1 |
  282. .*
  283. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  284. .*
  285. .*       Define initial tab settings to be ten spaces apart.
  286. .*       Set default tab character.
  287. .*
  288. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  289. .*
  290. .tb 11 21 31 41 51 61
  291. .tb set #
  292. .*
  293. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  294. .*
  295. .*       Define miscellaneous formatting macros:
  296. .*
  297. .*       .alp     to create a series of "alphabetic" points;
  298. .*
  299. .*       .blt     to format a point with a bullet;
  300. .*
  301. .*       .exam    to set off sample lines of terminal input
  302. .*                or JCL;
  303. .*
  304. .*       .pp      to begin a paragraph without indentation;
  305. .*
  306. .*       .seq     to create a series of numbered points;
  307. .*
  308. .*       .tentry  to create a table entry;
  309. .*
  310. .*       .tend    to end a series of table entries;
  311. .*
  312. .*       .tofc    to generate a Table of Contents;
  313. .*
  314. .*       .topic   to define a low-level heading that does not
  315. .*                warrant a decimal label.
  316. .*
  317. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  318. .*
  319. .cm                                 - - - alp         - - -
  320. .dm alp begin
  321. .if &T'&1 eq 'N'
  322. .  .th .do
  323. .     .se $alpct = &1
  324. .     .do end
  325. .if &e'&$alppend = 0 .sr $alppend = 0
  326. .if &0 eq 0 OR &T'&1 eq 'N'
  327. .  .th .do
  328. .     .if &$alppend = 0 .do begin
  329. .          .se $nestlevel = &$nestlevel + 1
  330. .          .se $alppend = &$nestlevel
  331. .          .in +4
  332. .          .do end
  333. .     .cp 5
  334. .     .sk 1
  335. .     .un 3
  336. .     .se *alpchr = &a'&$alpct
  337. .     &*alpchr..&sysrb.&syscont
  338. .* If we can continue on the same line do so, otherwise just overprint.
  339. .     .if '&syscont.' = ' ' .sk -1
  340. .     .se $alpct = &$alpct + 1
  341. .     .if &$alpct gt 26 .sr $alpct = 1
  342. .     .do end
  343. .  .el .do
  344. .     .if &$alppend ^= &$nestlevel .do begin
  345. .        .er 4 ATTEMPT TO END .alp OUT OF SEQUENCE.
  346. .        .ef
  347. .        .do end
  348. .     .sk 1;.sk 1 c
  349. .     .in -4
  350. .     .se $nestlevel = &$nestlevel - 1
  351. .     .sr $alppend = 0
  352. .     .sr $alpct = 1
  353. .     .do end
  354. .dm alp end
  355. .*
  356. .cm                                 - - - blt         - - -
  357. .dm blt begin
  358. .if &e'&$bltpend = 0 .sr $bltpend = 0
  359. .if &0 eq 0
  360. .th .do
  361. .      .if &$bltpend = 0 .do begin
  362. .            .se $nestlevel = &$nestlevel + 1
  363. .            .se $bltpend = &$nestlevel
  364. .            .in +4
  365. .            .do end
  366. .      .sk 1
  367. .      .un 3
  368. .      &$bullet.&sysrb.&sysrb.&syscont
  369. .* If we can continue on the same line do so, otherwise just overprint.
  370. .      .if '&syscont.' = ' ' .sk -1
  371. .      .do end
  372. .el .do begin
  373. .     .if &$bltpend ^= &$nestlevel .do begin
  374. .        .er 4 ATTEMPT TO END .blt OUT OF SEQUENCE.
  375. .        .ef
  376. .        .do end
  377. .     .sk 1;.sk 1 c
  378. .     .in -4
  379. .     .se $nestlevel = &$nestlevel - 1
  380. .     .sr $bltpend = 0
  381. .     .do end
  382. .dm blt end
  383. .*
  384. .cm                                 - - - exam        - - -
  385. .dm exam begin
  386. .if &0 eq 0
  387. .   .th .do
  388. .      .fo no
  389. .      .in +5
  390. .      .sk 1;.cp begin
  391. .      .do end
  392. .   .el .do
  393. .      .fo yes
  394. .      .br
  395. .      .in -5
  396. .      .br;.cp end
  397. .      .sk 1;.sk 1 c
  398. .      .do end
  399. .dm exam end
  400. .*
  401. .cm                                 - - - pp          - - -
  402. .dm pp begin
  403. .sk 1 c
  404. .dm pp end
  405. .*
  406. .cm                                 - - - seq         - - -
  407. .dm seq begin
  408. .if &0 gt 0 AND &T'&1 eq 'N'
  409. .   .th .do
  410. .      .se $seqct = &1
  411. .      .do end
  412. .if &e'&$seqpend = 0 .sr $seqpend = 0
  413. .if &0 eq 0 OR &T'&1 eq 'N'
  414. .   .th .do
  415. .      .if &$seqpend = 0 .do begin
  416. .            .se $nestlevel = &$nestlevel + 1
  417. .            .se $seqpend = &$nestlevel
  418. .            .in +5
  419. .            .do end
  420. .      .se *seqct = &$seqct
  421. .      .if &$seqct lt 10 .se *seqct = '&sysrb.&*seqct.'
  422. .      .sk 1
  423. .      .cp 5
  424. .      .un 4
  425. .      &*seqct.)&sysrb.&syscont
  426. .* If we can continue on the same line do so, otherwise just overprint.
  427. .      .if '&syscont.' = ' ' .sk -1
  428. .      .se $seqct = &$seqct + 1
  429. .      .do end
  430. .   .el .do
  431. .      .if &$seqpend ^= &$nestlevel .do begin
  432. .        .er 4 ATTEMPT TO END .seq OUT OF SEQUENCE.
  433. .        .ef
  434. .        .do end
  435. .      .sk 1;.sk 1 c
  436. .      .in -5
  437. .      .se $nestlevel = &$nestlevel - 1
  438. .      .sr $seqpend = 0
  439. .      .sr $seqct = 1
  440. .      .do end
  441. .dm seq end
  442. .*
  443. .cm                                 - - - tentry      - - -
  444. .dm tentry begin
  445. .if &0 eq 0
  446. .     .th .er 4 'MISSING TENTRY OPERAND'
  447. .el .do
  448. .  .if &$tenin = 99
  449. .     .th .se $tenin = &sysin
  450. .  .if &0 = 2 AND &T'&2 eq 'N'
  451. .     .th .se $tenof = &2
  452. .  .sk 1
  453. .  .in &$tenin+&$tenof
  454. .  .se *tenpad = (&$tenof - (&L'&1)) - 1
  455. .  .se *tenblank = ''
  456. .  .if &*tenpad gt 0
  457. .     .th .se *tenblank = '&$spb(1|&*tenpad)'
  458. .  .un &$tenof
  459. .  &1.&*tenblank
  460. .  .if &*tenpad lt 0
  461. .     .th .br
  462. .  .do end
  463. .dm tentry end
  464. .*
  465. .cm                                 - - - tend        - - -
  466. .dm tend begin
  467. .sk 1;.sk 1 c
  468. .in &$tenin
  469. .sr $tenin = 99
  470. .dm tend end
  471. .*
  472. .cm                                 - - - tofc        - - -
  473. .dm tofc begin
  474. .pa 1
  475. .pn roman
  476. .dh 1 pa noj nto us spaf 4
  477. .tc 1 Table of Contents
  478. .dm tofc end
  479. .*
  480. .cm                                 - - - topic       - - -
  481. .dm topic begin
  482. .if &0 eq 0
  483. . .th .er 4 MISSING TOPIC HEADING
  484. . .el .do
  485. .   .sk 2;.cp 7
  486. .   .ud on . , ( ) ^ 40
  487. .   .us !&$bullet !&1
  488. .   .ud off . , ( ) ^ 40
  489. .   .sk 1;.sk 1 c
  490. .   .do end
  491. .dm topic end
  492. .*
  493. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  494. .*
  495. .*       Define MACROs used to create decimal blocks.  They
  496. .*       are named BLOCK1, BLOCK2, and BLOCK3, and all require
  497. .*       a heading string, in quotes, as a parameter.  BLOCK1
  498. .*       allows the initial level number as a second parameter.
  499. .*
  500. .*       Also define MACROs used to create non-decimal blocks.
  501. .*       They are named HEAD1, HEAD2, and HEAD3, and all
  502. .*       require a heading string, in quotes, as a parameter.
  503. .*
  504. .*       Also define a MACRO that sets the "page eject"
  505. .*       trigger used by BLOCK1 and HEAD1 and another
  506. .*       macro that determines the blocks and headings
  507. .*       to be included in the Table of Contents.
  508. .*
  509. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  510. .*
  511. .cm                                 - - - block1      - - -
  512. .dm block1 begin
  513. .if &0 eq 0
  514. .th .er 4 MISSING BLOCK1 HEADING
  515. .el .do
  516. .ur .if &0 eq 2 AND &T'&2 eq 'N'
  517. .th .se $b1ct = &2
  518. .el .se $b1ct = &$b1ct + 1
  519. .sk 5
  520. .cp &$trigger
  521. .ud on . , ( ) ^ 40
  522. .ur .uc &$b1ct &1
  523. .ud off . , ( ) ^ 40
  524. .ur .if &$pitb1 = Y
  525. .th .ur .hl 1 &$b1ct &1
  526. .sk 3;.sk 2 c
  527. .do end
  528. .sr $b2ct = 0
  529. .sr $b3ct = 0
  530. .dm block1 end
  531. .*
  532. .cm                                 - - - block2      - - -
  533. .dm block2 begin
  534. .ur .if &0 eq 0
  535. .th .er 4 MISSING BLOCK2 HEADING
  536. .el .do
  537. .se $b2ct = &$b2ct + 1
  538. .sk 3;.cp 8
  539. .ud on . , ( ) ^ 40
  540. .ur .uc &$b1ct..&$b2ct &1
  541. .ud off . , ( ) ^ 40
  542. .ur .if &$pitb2 = Y
  543. .th .ur .hl 2 &$b1ct..&$b2ct &1
  544. .sk 1;.sk 1 c
  545. .do end
  546. .sr $b3ct = 0
  547. .dm block2 end
  548. .*
  549. .cm                                 - - - block3      - - -
  550. .dm block3 begin
  551. .ur .if &0 eq 0
  552. .th .er 4 MISSING BLOCK3 HEADING
  553. .el .do
  554. .se $b3ct = &$b3ct + 1
  555. .sk 3;.cp 8
  556. .ur .up &$b1ct..&$b2ct..&$b3ct &1
  557. .ur .if &$pitb3 = Y
  558. .th .ur .hl 3 &$b1ct..&$b2ct..&$b3ct &1
  559. .sk 1;.sk 1 c
  560. .do end
  561. .dm block3 end
  562. .*
  563. .cm                                 - - - head1      - - -
  564. .dm head1 begin
  565. .ur .if &0 eq 0
  566. .th .er 4 MISSING HEAD1 HEADING
  567. .el .do
  568. .sk 5
  569. .cp &$trigger
  570. .ud on . , ( ) ^ 40
  571. .ur .uc &1
  572. .ud off . , ( ) ^ 40
  573. .ur .if &$pith1 = Y
  574. .th .ur .hl 1 &1
  575. .sk 3;.sk 2 c
  576. .do end
  577. .dm head1 end
  578. .*
  579. .cm                                 - - - head2      - - -
  580. .dm head2 begin
  581. .ur .if &0 eq 0
  582. .th .er 4 MISSING HEAD2 HEADING
  583. .el .do
  584. .sk 3;.cp 8
  585. .ud on . , ( ) ^ 40
  586. .ur .uc &1
  587. .ud off . , ( ) ^ 40
  588. .ur .if &$pith2 = Y
  589. .th .ur .hl 2 &1
  590. .sk 1;.sk 1 c
  591. .do end
  592. .dm head2 end
  593. .*
  594. .cm                                 - - - head3      - - -
  595. .dm head3 begin
  596. .ur .if &0 eq 0
  597. .th .er 4 MISSING HEAD3 HEADING
  598. .el .do
  599. .sk 3;.cp 8
  600. .ur .up &1
  601. .ur .if &$pith3 = Y
  602. .th .ur .hl 3 &1
  603. .sk 1;.sk 1 c
  604. .do end
  605. .dm head3 end
  606. .*
  607. .cm                                 - - - pit        - - -
  608. .dm pit begin
  609. .sr $pitb1 = 'N';.sr $pitb2 = 'N';.sr $pitb3 = 'N'
  610. .sr $pith1 = 'N';.sr $pith2 = 'N';.sr $pith3 = 'N'
  611. .ur .pe &0
  612. .se $pit&1=Y;.se 1=&2;.se 2=&3;.se 3=&4;.se 4=&5;.se 5=&6
  613. .dm pit end
  614. .*
  615. .cm                                 - - - spt        - - -
  616. .dm spt begin
  617. .ur .if &0 eq 1 AND &T'&1 eq 'N'
  618. .th .se $trigger = &1
  619. .el .sr $trigger = 55
  620. .dm spt end
  621. .*
  622. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  623. .*
  624. .*       Define MACROs to allow footnoting using superscripts.
  625. .*            (Borrowed from UW EasyScript -jb)
  626. .*       Endnotes can be produced instead, by specifying
  627. .*
  628. .*                 SCRIPT filename (&NOTE= END
  629. .*
  630. .*       and using the .endnotes macro at the point where the
  631. .*       list is to appear.
  632. .*
  633. .*  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
  634. .*
  635. .cm                                 - - - footnote    - - -
  636. ..dm footnote begin
  637. ..sr $fnct = &$fnct + 1
  638. ..su &$fnconv
  639. &*1.&$fnout.&*2
  640. ..if &NOTE = END
  641. .   ..th ..fb begin
  642. .   ..el ..fn begin
  643. ..sk
  644. ..su &$enconv
  645. ..in;..in &$fnlen;..un &$fnun
  646. ..tr 02 4b
  647. &$fnout
  648. ..tr 02
  649. ..dm
  650. .cm                                 - - - footend     - - -
  651. .dm footend begin
  652. ..if ¬e = 'END'
  653. .   ..th ..fb end
  654. .   ..el ..fn end
  655. .dm footend end
  656. .*
  657. .cm                                 - - - endnotes    - - -
  658. .dm endnotes begin
  659. ..if ¬e ne 'END'
  660. .   ..th ..ef
  661. ..br
  662. ..fb dump
  663. .dm endnotes end
  664. .*
  665.